import type { Ref } from 'vue'
import { inject, provide } from 'vue'

const key = Symbol('collapse')

interface Data {
  collapsed: Ref<boolean>
  collapsedRow?: number
  collapsedNum?: number
}
export function provideCollapse(data: Data) {
  provide(key, data)
}

export function useCollapse() {
  return inject(key, {}) as Data
}
